<?php

namespace app\api\controller;

use app\BaseController;
use think\facade\Request;
use think\facade\Cache;

class Base extends BaseController
{
    protected $middleware = ['api_check_token'];
    public $token;


    public function __construct()
    {
    }

    /**
     * 获取用户id
     * @return mixed
     */
    public function getUserID()
    {
        $header = Request::header();
        $redis = Cache::store('redis')->handler();
        $redis->select(8);
        return $redis->get($header['token']);
    }



}